import request from '../utils/api';

// 用户管理相关API
const userApi = {
  // 获取用户列表
  getUserList: (params) => {
    return request({
      url: '/user/list',
      method: 'get',
      params
    });
  },
  
  // 根据ID获取用户
  getUserById: (id) => {
    return request({
      url: `/user/${id}`,
      method: 'get'
    });
  },
  
  // 添加用户
  addUser: (user) => {
    return request({
      url: '/user',
      method: 'post',
      data: user
    });
  },
  
  // 更新用户
  updateUser: (user) => {
    return request({
      url: '/user',
      method: 'put',
      data: user
    });
  },
  
  // 删除用户
  deleteUser: (id) => {
    return request({
      url: `/user/${id}`,
      method: 'delete'
    });
  }
};

export default userApi;